/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package remote;

import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Nuno
 */
public class progress extends Thread {
    private float progress;
    private float size;
    private File f;
    
    public progress(String size, File f){
        progress=0;
        this.size=Float.parseFloat(size);
        this.f=f;
    }

    @Override
    public void run(){

        while(progress<100){
            progress=((f.length()/size)*100);
            //System.out.println((int)progress + "%  bytes:" + f.length() + " total: " + size);
            try {
                sleep(1000);
            } catch (InterruptedException ex) {
                Logger.getLogger(progress.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }



}
